<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use app\common\widgets\MyFileUpload;

/* @var $this yii\web\View */
/* @var $model app\models\GkyWeReplyNews */
/* @var $form yii\widgets\ActiveForm */
?>

<script type="text/javascript" src="js/qiniuupload/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/qiniuupload/plupload/plupload.full.min.js"></script>
<script type="text/javascript" src="js/qiniuupload/plupload/i18n/zh_CN.js"></script>
<script type="text/javascript" src="js/qiniuupload/ui.js"></script>
<script type="text/javascript" src="js/qiniuupload/qiniu.js"></script>
<script type="text/javascript" src="js/qiniuupload/highlight/highlight.js"></script>
<script type="text/javascript" src="js/qiniuupload/main.js"></script>

<div class="gky-we-reply-news-form">
<div class="panel panel-default">
        <!--<div class="panel-heading text-center" style="background: #003eff;color:white">gky-we-reply-news</div>-->
        <div class="panel-body">
    <?php $form = ActiveForm::begin([
                'options' => ['class' => 'form-horizontal form-group'],
                'fieldConfig' => [
                    'template' => "{label}<div class=\"col-lg-10\">{input}</div>",
                    'labelOptions' => ['class' => 'col-lg-2 control-label'],
                ]
    ]); ?>

     <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'keyword')->textInput(['maxlength' => true]) ?>
    </div>
         <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
             <?php
             $types = [
                 ['key'=>0,'value'=>'精确匹配'],
                 ['key'=>1,'value'=>'模糊匹配'],
             ];
             echo $form->field($model, 'keyword_type')
                 ->dropDownList(
                     ArrayHelper::map($types,'key','value')
                 )
                 ->label('匹配类型')
             ?>
    </div>
         <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
    </div>

    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'jump_url')->textInput(['maxlength' => true]) ?>
    </div>
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?= $form->field($model, 'sort')
           ->dropDownList(
               [1,2,3,4,5],
               ['prompt' => '请选择优先级'])
           ->label('优先级 （数值越小越先匹配）')
       ?>
    </div>
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
       <?php
       $accounts = \app\models\GkyWeAccount::find()->all();
       echo $form->field($model, 'weoid')
           ->dropDownList(
               ArrayHelper::map($accounts,'weoid','wename'),
               ['prompt' => '请选择公众号']
           )
           ->label('公众号')
       ?>
    </div>
    <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
        <?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>
    </div>
    <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
        <?= MyFileUpload::widget() ?>
    </div>
    <div class="form-group col-lg-12 col-xs-12 col-sm-12 col-md-12">
        <?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success col-lg-offset-5 col-xs-offset-5 col-sm-offset-5 col-md-offset-5' : 'btn btn-primary col-lg-offset-5 col-xs-offset-5 col-sm-offset-5 col-md-offset-5']) ?>
        <?= Html::a('返回', ['index'], ['class' => 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>
      </div>
    </div>

</div>
